#include "dataset_io.h"

#include <opencv2/core/core.hpp>
#include <opencv2/opencv.hpp>

using namespace std;
using namespace cv;

int main(int argc, char **argv) {
    auto config = YAML::LoadFile(argv[1]);

    // DatasetIoFactory DIF;
    auto interface =
        DatasetIO::DatasetIoFactory::getDatasetIo(std::string("panovideo"));

    LOG(INFO) << "test panovideo";

    std::string datasetbase_path = config["datasetbase_path"].as<std::string>();
    interface->read(datasetbase_path);

    std::string save_path = datasetbase_path + std::string("/result");

    // other params
    int image_idx = 0;
    std::string voc_path = config["voc_path"].as<std::string>();
    int image_skip = config["image_skip"].as<int>();

    std::string cam_config_path =
        config["camera_config_path"].as<std::string>();
    auto camera_config = YAML::LoadFile(cam_config_path);

    // Main loop
    DatasetIO::MonoImageData::Ptr pano_data;
    while ((pano_data = (interface->get_data())->get_next_mono_image_data())) {
        if (!(image_idx++ % image_skip == 0))
            continue;

        std::vector<cv::Mat> images(1);
        images[0] = pano_data->data.clone();
    }

    return 0;
}
